Dialog box for search Script system for search Ignoring uppercase / lowercase Entire Word option Regular Expression Search Expression for search string Expression for replace string |
◊ | if documents are open, QuoEdit uses the script system which the font of the front document belongs to. |
◊ | if no documents are open, QuoEdit uses the preferred script system, that is, script system which the default font (preferred by you) belongs to. |
Position specifiers
Expression | Description | |||
^ | Matches beginning of paragraph if specified at beginning of a pattern sequence. For example: ^\t —> matches tab at the beginning of the paragraph | |||
| ||||
$ | Matches end of paragraph if specified at end of a pattern sequence. For example: \)$ —> matches “)” at the end of the paragraph | |||
| ||||
\b | Matches word boundary position (if not used in a character class) | |||
| ||||
\B | Matches position where it is not word boundary | |||
|
Expression | Description | |||
. (period) | Matches any character other than return character or “.” if specified in Character Class. | |||
| ||||
\s | Matches any blank character or “s” if specified in Character Class.* | |||
| ||||
\S | Matches any character other than blank character or “S” if specified in Character Class. | |||
| ||||
\b | If specified in Character Class, matches a backspace (\x08). | |||
| ||||
\e | Matches an escape (\x1B). | |||
| ||||
\f | Matches a form feed (\x0C). | |||
| ||||
\n | Matches a line feed (\x0A). | |||
| ||||
\r | Matches a carriage return (\x0D: return character for Macintosh).** | |||
| ||||
\t | Matches a tab (\x09).** | |||
| ||||
\xHH | Matches a character by hexadecimal code. (HH is hexadecimal number by 1 to 4 figures.) \x9, \x09, \x009 and \x0009 are equivalent (at least in QuoEdit). To distinguish easily the hexadecimal code and characters that follow, use 4 figures. | |||
| ||||
\cC | Matches a control character. C is an alphabet. | |||
| ||||
\C | Matches the character that follows ‘\’ if the sequence is not metacharacter. (C is any character.) Always case sensitive. ‘\’ makes the metacharacter that follows literal character and it is called “escape”. For example: \| —> matches “|” \\ —> matches “\” | |||
| ||||
C | Matches the character itself if not metacharacter. (C is any character.) For example: a —> matches “a” (or “A” if Ignore Case option is on) | |||
| ||||
[...] | Character Class: matches one of the characters in the bracket. Always case sensitive. ‘-’ can be used to specify a range (in the character code). To specify the character “-”, put it at the beginning or the last. Character specifiers listed above (except period, \s and \S) are available in the character class. But note that other metacharacters (like position specifiers) are not interpreted as metacharacter any more in the character class (except ^ at the beginning). For example: [abc] —> matches “a”, “b” or “c” [a-z] —> matches “a”, “b”, “c”, ...... “y” or “z” [a-z-] —> matches “a”, “b”, “c”, ...... “y”, “z” or “-” | |||
| ||||
[^...] | Negative character class: matches any character not in the bracket. Always case sensitive. For example: [^0-9a-zA-Z] —> matches any character other than alphanumeric characters | |||
|
* | \s matches every character whose code is 20h or less and any character which is determined as a blank character by the script system of Mac OS. This is an extended behavior in QuoEdit for regular expression. Note that you cannot specify \s (and \S) in Character Class because the character class cannot determine what characters are blank characters specific to the Mac OS script system. |
** | You can also input return and tab characters directly (with control + return/tab) instead of the metacharacters. |
Expression | Description | |||
| | Or: allows you to specify alternation. For example: this|that —> matches “this” or “that” The longer candidate has priority for the match so that the order does not matter. th|the|these these|the|th ‘|’ divides a pattern sequence into two sequences so that the following two expressions are equal. ^\t|\)$ \)$|^\t | |||
|
Expression | Description | |||
(...) | Groups pattern sequence (or single pattern) as one pattern. Note that even a character in the string is a pattern. For example: foo+ —> matches “foo”, “fooo”, “fooooooo” etc. (foo)+ —> matches “foo”, “foofoo”, “foofoofoo” etc. \b(we|you|i)\b —> matches a word “we”, “you” or “i” | |||
| ||||
\1, \2, \3 ... \9 | Backreference to the matched text of the nth group.* Nested groups are also counted. For example: (my|your) ([A-Za-z]+) (is|are) \1 \2 ((my|your) ([A-Za-z]+)) (is|are) \2 \3 ((my|your) [A-Za-z]+) (is|are) \1 —> match “my money is my money” etc. (does not match “your money is my money”) | |||
|
* | Don’t use backreference to a group that may not match. Such a reference can refer to unexpected text at all in the search process. (QuoEdit is stupid on this point.) For example; ((we|you) are|I am) happy that \2 like it at the time this expression partially matched “I am happy that ”, \2 can refer to unexpected text; it may refer to a large text that starts with “we” and ends with “you” while it may refer to nothing. |
Expression | Description | |||
? | Zero or one time of preceding pattern (greedy). | |||
| ||||
* | Zero or more times of preceding pattern (greedy). | |||
| ||||
+ | One or more times of preceding pattern (greedy). | |||
| ||||
{min,max} | min or more times and max or less times of preceding pattern* (greedy). If min was omitted: 0 / If max was omitted: unlimited* {0,0} is unavailable. Only numbers or a comma are available in the brace. | |||
| ||||
{n} | n times of preceding pattern.* {0} is unavailable. | |||
|
* | In QuoEdit, the maximum is limited to 32767 for convenience so that specifying more value results in error. (Here, “unlimited” is a lie.) |
Group match
Expression | Description | |||
\0 | A reference to text that search expression matched.* | |||
| ||||
\1, \2, \3 ... \9 | A reference to text that the nth group in the search expression matched.*/** The feature is similar to backreference used for search string. | |||
|
* | The reference to the text is kept until the next search, until the text is modified (replaced or edited) or until the document window is closed, so that you can use it even in the other document window with Replace command or AppleScript (with Group Match object). |
** | Don’t use reference to a group that may not match. Such a reference can refer to unexpected text. (QuoEdit is not so clever on this point.) For example; ((a|an)|the) [a-z]+ if this expression matched “the apple”, you would expect that \2 refers to nothing. But actually it can refer to strange text, though this case never occur unless the whole match and the (thing like) group match overlap entirely. |
Expression | Description | |||
\b | Expresses a backspace (\x08). | |||
| ||||
\e | Expresses an escape (\x1B). | |||
| ||||
\f | Expresses a form feed (\x0C). | |||
| ||||
\n | Expresses a line feed (\x0A). | |||
| ||||
\r | Expresses a carriage return (\x0D: return character for Macintosh). | |||
| ||||
\t | Expresses a tab (\x09). | |||
| ||||
\xHH | Expresses a character by hexadecimal code. (HH is hexadecimal number by 1 to 4 figures.) | |||
| ||||
\cC | Expresses a control character. (C is an alphabet.) | |||
| ||||
\C | Expresses the character that follows ‘\’ if the sequence is not metacharacter. (C is any character.) To specify character “\”, input “\\”. (Actually, only “\” would have the sense to escape in the replace string.) | |||
| ||||
other | Expresses the character itself if not metacharacter. | |||
|